#pragma once

#include "pch.h"

class PartialShot : public QWidget {
Q_OBJECT
public:
    explicit PartialShot(QWidget *paretn = nullptr);

    ~PartialShot() override = default;

    void setScreenImage(const QPixmap &screenImage);

protected:
    void mousePressEvent(QMouseEvent *event) override;

    void mouseReleaseEvent(QMouseEvent *event) override;

    void mouseMoveEvent(QMouseEvent *event) override;

    void paintEvent(QPaintEvent *event) override;

    void showEvent(QShowEvent *event) override;

    void keyPressEvent(QKeyEvent *event) override;

private:
    bool mouse_pressed = false;
    QPoint start_pos{-1, -1};
    QPoint end_pos{-1, -1};
    QPixmap screen_image;
    QRect save_rect{this->geometry()};
};
